Skip to content

feat: disable session cookie/localStorage when noFunctional is set#1070

Merged
jaissica12 merged 15 commits into
developmentfrom
feat/SDKE-91-disable-session-cookie-localStorage-when-noFunctional-is-set
Oct 1, 2025
Merged

feat: disable session cookie/localStorage when noFunctional is set#1070
jaissica12 merged 15 commits into
developmentfrom
feat/SDKE-91-disable-session-cookie-localStorage-when-noFunctional-is-set

Conversation

@jaissica12

Copy link
Copy Markdown
Contributor

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

  • In persistence, updated to disable localStorage/cookies when noFunctional is set.
  • added if block that localStorage is enabled when noFunctional is not set.
  • Added jest and integration tests

Testing Plan

  • Was this tested locally? If not, explain why.
  • {explain how this has been tested, and what, if any, additional testing should be done}

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

@jaissica12 jaissica12 marked this pull request as ready for review September 16, 2025 21:55
Comment thread src/persistence.js Outdated
Comment thread src/persistence.js Outdated
Comment thread src/persistence.js Outdated
Comment thread src/persistence.js Outdated
Comment thread test/jest/persistence.spec.ts Outdated

it('should NOT write to cookie when useCookieStorage is true', () => {
store.SDKConfig.useCookieStorage = true;
jest.clearAllMocks();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can add an afterEach block and include jest.clearAllMocks() in that.

Comment thread test/jest/persistence.spec.ts Outdated
Comment thread test/src/tests-persistence.ts Outdated
Comment thread test/src/tests-persistence.ts
Comment thread test/src/tests-persistence.ts
@jaissica12 jaissica12 requested a review from rmi22186 September 22, 2025 12:06
Comment thread test/jest/persistence.spec.ts Outdated
Comment thread test/jest/persistence.spec.ts Outdated
@jaissica12 jaissica12 requested a review from rmi22186 September 23, 2025 18:36
Comment thread src/persistence.js Outdated
Comment thread src/persistence.js Outdated
@jaissica12 jaissica12 requested a review from rmi22186 September 29, 2025 14:51
Comment thread src/persistence.js Outdated
Comment thread test/jest/persistence.spec.ts Outdated
Comment thread test/jest/persistence.spec.ts
Comment thread test/jest/persistence.spec.ts Outdated
Comment thread test/jest/persistence.spec.ts Outdated
Comment thread test/jest/persistence.spec.ts Outdated
Comment thread test/jest/persistence.spec.ts
Comment thread test/src/tests-persistence.ts Outdated
Comment thread test/src/tests-persistence.ts Outdated
Comment thread test/src/tests-persistence.ts Outdated
Comment thread test/jest/persistence.spec.ts Outdated
Comment thread src/persistence.js Outdated

@rmi22186 rmi22186 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one minor nit

@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2025

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
39.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@jaissica12 jaissica12 requested a review from rmi22186 October 1, 2025 13:11
@jaissica12 jaissica12 merged commit edb2e61 into development Oct 1, 2025
208 of 229 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 1, 2025
# [2.47.0](v2.46.0...v2.47.0) (2025-10-01)

### Bug Fixes

* SDKE-317 Call deferred methods on Rokt Manager instead of kit ([#1076](#1076)) ([3a0643b](3a0643b))

### Features

* added DisabledVault to disable id-cache when noFunctional is set ([#1072](#1072)) ([8187d72](8187d72))
* added noFunctional in batchUploader to disable offline storage ([#1063](#1063)) ([97dd88a](97dd88a))
* disable session cookie/localStorage when noFunctional is set ([#1070](#1070)) ([edb2e61](edb2e61))
* disable time tracking when noTargeting is set to true ([#1064](#1064)) ([71c891c](71c891c))
@mparticle-automation

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 2.47.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants